package com.snail.auth.dao;

import com.snail.auth.entity.AuthAuthority;
import com.common.core.BaseRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface AuthAuthorityRep extends BaseRepository<AuthAuthority, Long> {

    public List<AuthAuthority> findByMenuId(Long menuId);

    @Query(value = "select au.* from auth_authority au,auth_role_authority re where au.id = re.authority_id and re.role_id=?1", nativeQuery = true)
    public List<AuthAuthority> getByRoleId(Long roleId);

    public AuthAuthority getById(Long id);

}
